\subsection{Direct products of groups}
\begin{definition}
	The direct product of two groups \(G\) and \(H\) is written \(G \times H\), and defined to be \(\{ (g, h) : g \in G, h \in H \}\), where the group operation is defined by
	\[
		(g_1, h_1) \ast_{G \times H} (g_2, h_2) = (g_1 \ast_G g_2, h_1 \ast_H h_2)
	\]
\end{definition}
We will now prove that this really is a group.
\begin{proof}
	We prove each axiom.
	\begin{itemize}
		\item (closure) For a pair of elements \((g_1, h_1)\) and \((g_2, h_2)\) in \(G \times H\), the product \((g_1 \ast_G g_2, h_1 \ast_H h_2)\) is clearly in \(G \times H\), because the first entry is in \(G\) and the second entry is in \(H\), which is the requirement for being a member of \(G \times H\).
		\item (identity) The element \((e_G, e_H)\) is an identity.
		\item (inverses) Given an element \((g, h) \in G \times H\), the element \((g^{-1}, h^{-1})\) satisfies
		\[(g^{-1}, h^{-1})(g, h) = (e_G, e_H) = e_{G \times H}\]
		\item (associativity) Given three elements \((g_i, h_i)\), \(i \in \{1, 2, 3\}\), we have
		      \begin{align*}
			      ((g_1, h_1) \ast (g_2, h_2)) \ast (g_3, h_3) & = (g_1 \ast g_2, h_1 \ast h_2) \ast (g_3, h_3)       \\
			                                                   & = ((g_1 \ast g_2) \ast g_3, (h_1 \ast h_2) \ast h_3) \\
			                                                   & = (g_1 \ast (g_2 \ast g_3), h_1 \ast (h_2 \ast h_3)) \\
			                                                   & = (g_1, h_1) \ast (g_2 \ast g_3, h_2 \ast h_3)       \\
			                                                   & = (g_1, h_1) \ast ((g_2, h_2) \ast (g_3, h_3))
		      \end{align*}
	\end{itemize}
\end{proof}
\(G \times H\) contains subgroups \(G \times {e_H}\) and \({e_G} \times H\) which are isomorphic to \(G\) and \(H\) respectively.
We name these subgroups simply \(G\) and \(H\) because they are isomorphic.
\begin{note}
	In \(G \times H\), everything in \(G\) commutes with everything in \(H\).
	\[
		\forall g \in G, \forall h \in H, (g, e_H) \ast (e_G, h) = (e_G, h) \ast (g, e_H) = (g, h)
	\]
\end{note}

\begin{theorem}[Direct Product Theorem]
	Let \(H, K\) be subgroups of \(G\) such that
	\begin{itemize}
		\item \(H \cap K = \{ e \}\) (the groups intersect only in \(e\))
		\item \(\forall h \in H, \forall k \in K, hk = kh\) (\(H\) and \(K\) commute in \(G\))
		\item \(\forall g \in G, \exists h \in H, \exists k \in K \st g = hk\) (\(G = HK\))
	\end{itemize}
	Then \(G \cong H \times K\).
\end{theorem}
\begin{proof}
	Consider \(\varphi: H \times K \to G\) where \(\varphi((h, k)) = hk\).
	We now prove that \(\varphi\) is a homomorphism.
	\begin{align*}
		\varphi((h_1, k_1)(h_2, k_2)) & = \varphi((h_1h_2, k_1k_2))              \\
		                              & = h_1h_2k_1k_2                           \\
		                              & = h_1k_1h_2k_2                           \\
		                              & = \varphi((h_1, k_1))\varphi((h_2, k_2))
	\end{align*}
	Note that by the third property in the theorem we know that \(\varphi\) is surjective.
	We now prove that \(\varphi\) is also injective.

	Suppose that \((h, k) \in \ker \varphi\).
	Then \(\varphi((h, k)) = e_G\) so \(hk = e_G\).
	So \(h = k^{-1}\).
	This means that there is some element that is part of both \(H\) and \(K\), for example \(h\).
	But by the first property in the theorem, this value must be \(e\), so \(\ker \varphi = \{ e_G \}\), so \(\varphi\) is injective.

	\(\varphi\) is an injective, surjective homomorphism, so it is an isomorphism.
	So \(G\) is isomorphic to \(H \times K\).
\end{proof}

Now, we can consider direct products in two distinct lenses: a combination of smaller groups to form a large one, or a partition of a large group into two that combine to produce the original.

\subsection{Cyclic groups}
\begin{definition}
	Let \(G\) be a group, and let \(X \subseteq G\) be some subset.
	If \(\genset{X} = G\) then \(X\) is a generating set of \(G\).
	We say that \(G\) is cyclic if there exists some element \(a\) in \(G\) such that \(\genset{a} = G\).
	\(a\) is called a generator of \(G\).
\end{definition}
\begin{enumerate}
	\item The trivial group \(\{ e \}\) is generated by its element.
	\item \((\mathbb Z, +)\) is a cyclic group generated by \(\mathbb Z = \genset{-1} = \genset{1}\).
	\item \((\mathbb Z_n, +)\), where addition is modulo \(n\), is generated by \(\mathbb Z_n = \genset{k}\) where \(k\) and \(n\) are coprime.
\end{enumerate}
\begin{theorem}
	Any cyclic group \(G\) is isomorphic to \(C_n\) (for some \(n \in \mathbb N\)) or \(\mathbb Z\).
\end{theorem}
\begin{proof}
	Let \(G = \genset b\).
	Then suppose that there exists some natural number \(n\) such that \(b^n = e\).
	We take the smallest such \(n\), and define \(\varphi: C_n \to G\) by \(\varphi(a^k) = b^k\) where the elements of \(C_n\) are \(e, a, a^2\) and so on.

	We now show that \(\varphi\) is a homomorphism.
	For any two elements \(a^j, a^k \in C_n\), we have two cases.
	If \(j + k < n\), then \(\varphi(a^j \cdot a^k) = \varphi(a^{j+k}) = b^{j+k} = b^j \cdot b^k = \varphi(a^j) \cdot \varphi(a^k)\) as required.
	Otherwise, \(j + k \geq n\), then \(\varphi(a^j \cdot a^k) = \varphi(a^{j+k-n}) = b^{j+k}(b^n)^{-1} = b^{j+k}\cdot e = b^{j+k} = b^j \cdot b^k = \varphi(a^j) \cdot \varphi(a^k)\) as required.

	Note that \(\varphi\) is bijective:
	\begin{itemize}
		\item \(b^n = e \in G\) implies that all elements of \(G\) can be written \(b^k\) where \(0 \leq k < n\), so \(\varphi\) is surjective; and
		\item Let \(a^k\) be an element in the kernel of \(\varphi\) where \(0 \leq k < n\).
		      Then \(\varphi(a^k) = e \implies b^k = e\).
		      But \(k\) must be zero, because any other value would contradict the fact that we chose \(n\) to be the smallest number with this property.
		      So the kernel is trivial.
	\end{itemize}
	So \(\varphi\) is an isomorphism, and \(G \cong C_n\).

	If alternatively there exists no \(n\) such that \(b^n = e\), then we construct \(\varphi: \mathbb Z \to G\) by \(\varphi(k) = b^k\).
	Then \(\varphi(k + m) = b^{k+m} = b^k \cdot b^m = \varphi(k) \cdot \varphi(m)\), so \(\varphi\) is a homomorphism.
	Clearly \(\varphi\) is surjective because all elements of \(G\) can be constructed with powers of \(b\).
	Now, suppose \(m \in \ker \varphi\) where \(m\) is nonzero.
	Then \(\varphi(m) = b^m = e\) and \(\varphi(-m) = b^{-m} = e\).
	So one of \(m\) and \(-m\) is positive, contradicting the fact that there is no such \(n>0\) where \(b^n = e\).
	So the kernel is trivial, so \(\varphi\) is an isomorphism, so \(G \cong \mathbb Z\).
\end{proof}

\begin{definition}
	The order of an element \(g\in G\) is the smallest \(n \in \mathbb N\) such that \(g^n = e\).
	We say that \(\ord g = n\).
	If there is no such \(n\), then \(\ord g = \infty\).
\end{definition}
Note that given some \(g \in G\), the subgroup \(\genset g\) is a cyclic group isomorphic to \(C_n\) if \(\ord g = n\), and isomorphic to \(\mathbb Z\) if \(\ord g = \infty\).
So \(\ord g = \abs{\genset g}\).
\begin{proposition}
	Cyclic groups are abelian.
\end{proposition}
The proof is trivial.

\subsection{Dihedral groups}
\begin{definition}
	The dihedral group \(D_{2n}\) is the group of symmetries of a regular \(n\)-gon.
	The group operation is composition of transformations.
	For example, \(D_6\) is the group of symmetries of a regular triangle.
\end{definition}
The elements of a general \(D_{2n}\) fall into two categories:
\begin{itemize}
	\item (rotations) We can rotate the shape around its centre through \(\frac{2\pi k}{n}\).
	      There are \(n\) such rotations, including the identity element \(e\).
	\item (reflections) We can reflect the shape across axes through each vertex and the shape's centre.
	      If \(n\) is odd, then there are \(n\) such symmetries.
	      If \(n\) is even, there are \(n/2\) such symmetries, but there are a further \(n/2\) symmetries through the midpoints of edges and the centre of the shape, leaving a total of \(n\).
\end{itemize}
Therefore there are (at least) \(2n\) elements in \(D_{2n}\).
Are these all the elements?
To answer this, let us name vertices \(v_1, v_2 \cdots v_n\), and let us consider some element \(g\) of \(D_{2n}\).
There are two characteristics of a rigid symmetry:
\begin{itemize}
	\item Vertices are mapped to other vertices.
	      So \(v_1 \mapsto v_k\) for some \(1 \leq k \leq n\).
	\item Edges are mapped to other edges.
	      So \(v_2 \mapsto v_{k+1}\) or \(v_{k-1}\) (modulo \(n\)).
	      Note that once we define \(v_1\) and \(v_2\), then the location of \(v_3\) is predetermined.
	      Inductively, the entire polygon is pre-determined.
\end{itemize}
There are \(n\) choices for the location of \(v_1\).
There are two choices for the location of \(v_2\).
So there are only \(2n\) elements in \(D_{2n}\).
So we have all the elements already.
It is also trivial to prove that \(D_{2n}\) is a group, simply by verifying the axioms, noting the function composition is always associative.

Note that we can generate \(D_{2n}\) using just one rotation and one reflection.
Let \(r\) be the rotation by \(\frac{2\pi}{n}\), and let \(s\) be the reflection through \(v_1\) (such that \(v_1 \mapsto v_1\)).
Now,
\begin{itemize}
	\item \(r^k\) gives all possible rotations;
	\item \(r^i s r^{-i}\) gives a reflection through \(v_{i+1}\) and the centre;
	\item \(r^{i+1} s r^{-i}\) gives a reflection through the edge joining \(v_{i}\) and \(v_{i+1}\).
\end{itemize}
These are all three cases, so \(D_{2n} = \genset{r, s}\).
